﻿namespace GSC.WebControls
{
    using System;
    using System.Collections.Generic;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;
    /// <summary>
    /// 异步ID序列化。
    /// </summary>
    /// <remarks>异步ID序列化。</remarks>
    public class AsyncIDsSerialize
    {
        Control _control;
        List<string> _ids;// = new List<string>();
        /// <summary>
        /// 系列化异步ID列表。
        /// </summary>
        /// <remarks>系列化异步ID列表。</remarks>
        public List<string> Serialize()
        {
            if (_ids == null)
            {
                _ids = new List<string>();
            }
            IAsyncControlIDsExtender iAsyncIDsExtender = _control as IAsyncControlIDsExtender;
            if (iAsyncIDsExtender == null)
            {
                if (_control is LinkButton || _control is ImageButton || _control is Button || _control is DropDownList)
                {
                    if (!_ids.Contains(_control.ClientID))
                    _ids.Add(_control.ClientID);
                }
                else
                {
                    Depth(_control, ref  _ids);
                }
            }
            else
            {
                if (iAsyncIDsExtender.ControlIDs != null)
                {
                    _ids.AddRange(iAsyncIDsExtender.ControlIDs);
                }
            }
            return _ids;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="parent"></param>
        /// <param name="ids"></param>
        private void Depth(Control parent, ref List<string> ids)
        {
            if (parent is LinkButton || parent is ImageButton || parent is Button || parent is DropDownList)
            {
                if (!ids.Contains(parent.ClientID))
                    ids.Add(parent.ClientID);
            }
            else
            {
                foreach (Control item in parent.Controls)
                {
                    if (item is LinkButton || item is ImageButton || item is Button || item is DropDownList)
                    {
                        if (!ids.Contains(item.ClientID))
                            ids.Add(item.ClientID);
                    }
                    else
                    {
                        Depth(item, ref ids);
                    }
                }
            }
             /*
            if (parent is Table)
            {
                foreach (TableRow item in ((Table)parent).Rows)
                {
                    foreach (TableCell citem in item.Cells)
                    {
                        foreach (Control ccitem in citem.Controls)
                        {
                            if (ccitem is LinkButton || ccitem is ImageButton || ccitem is Button)
                            {
                                ids.Add(ccitem.ClientID);
                            }
                            else if (ccitem is DropDownList)
                            {
                                if (((DropDownList)ccitem).AutoPostBack)
                                {
                                    ids.Add(ccitem.ClientID);
                                }
                            }
                            else if (ccitem is CheckBox)
                            {
                                if (((CheckBox)ccitem).AutoPostBack)
                                {
                                    ids.Add(ccitem.ClientID);
                                }
                            }
                            else
                            {
                                this.AddNext(ccitem, ref ids);
                            }
                        }
                    }
                }
            }
            else if (parent is TableRow)
            {
                foreach (TableCell citem in ((TableRow)parent).Cells)
                {
                    foreach (Control ccitem in citem.Controls)
                    {
                        if (ccitem is LinkButton || ccitem is ImageButton || ccitem is Button)
                        {
                            ids.Add(ccitem.ClientID);
                        }
                        else if (ccitem is DropDownList)
                        {
                            if (((DropDownList)ccitem).AutoPostBack)
                            {
                                ids.Add(ccitem.ClientID);
                            }
                        }
                        else if (ccitem is CheckBox)
                        {
                            if (((CheckBox)ccitem).AutoPostBack)
                            {
                                ids.Add(ccitem.ClientID);
                            }
                        }
                        else
                        {
                            this.AddNext(ccitem, ref ids);
                        }
                    }
                }
            }
            else if (parent is HtmlTable)
            {
                foreach (HtmlTableRow item in ((HtmlTable)parent).Rows)
                {
                    foreach (HtmlTableCell citem in item.Cells)
                    {
                        foreach (Control ccitem in citem.Controls)
                        {
                            if (ccitem is LinkButton || ccitem is ImageButton || ccitem is Button)
                            {
                                ids.Add(ccitem.ClientID);
                            }
                            else if (ccitem is DropDownList)
                            {
                                if (((DropDownList)ccitem).AutoPostBack)
                                {
                                    ids.Add(ccitem.ClientID);
                                }
                            }
                            else if (ccitem is CheckBox)
                            {
                                if (((CheckBox)ccitem).AutoPostBack)
                                {
                                    ids.Add(ccitem.ClientID);
                                }
                            }
                            else
                            {
                                this.AddNext(ccitem, ref ids);
                            }
                        }
                    }
                }
            }
            else if (parent is HtmlTableRow)
            {
                foreach (HtmlTableCell citem in ((HtmlTableRow)parent).Cells)
                {
                    foreach (Control ccitem in citem.Controls)
                    {
                        if (ccitem is LinkButton || ccitem is ImageButton || ccitem is Button)
                        {
                            ids.Add(ccitem.ClientID);
                        }
                        else if (ccitem is DropDownList)
                        {
                            if (((DropDownList)ccitem).AutoPostBack)
                            {
                                ids.Add(ccitem.ClientID);
                            }
                        }
                        else if (ccitem is CheckBox)
                        {
                            if (((CheckBox)ccitem).AutoPostBack)
                            {
                                ids.Add(ccitem.ClientID);
                            }
                        }
                        else
                        {
                            this.AddNext(ccitem, ref ids);
                        }
                    }
                }
            }
            else if (parent is ListView)
            {
                foreach (ListViewDataItem item in ((ListView)parent).Items)
                {
                    foreach (Control citem in item.Controls)
                    {
                        if (citem is HtmlTableCell)
                        {
                            foreach (Control ccitem in citem.Controls)
                            {
                                if (ccitem is LinkButton || ccitem is ImageButton || ccitem is Button)
                                {
                                    ids.Add(ccitem.ClientID);
                                }
                                else if (ccitem is DropDownList)
                                {
                                    if (((DropDownList)ccitem).AutoPostBack)
                                    {
                                        ids.Add(ccitem.ClientID);
                                    }
                                }
                                else if (ccitem is CheckBox)
                                {
                                    if (((CheckBox)ccitem).AutoPostBack)
                                    {
                                        ids.Add(ccitem.ClientID);
                                    }
                                }
                                else
                                {
                                    this.AddNext(ccitem, ref ids);
                                }
                            }
                        }
                    }
                }
            }
            else if (parent is FormView)
            {
                foreach (TableCell citem in ((FormView)parent).Row.Cells)
                {
                    foreach (Control ccitem in citem.Controls)
                    {
                        if (ccitem is LinkButton || ccitem is ImageButton || ccitem is Button)
                        {
                            ids.Add(ccitem.ClientID);
                        }
                        else if (ccitem is DropDownList)
                        {
                            if (((DropDownList)ccitem).AutoPostBack)
                            {
                                ids.Add(ccitem.ClientID);
                            }
                        }
                        else if (ccitem is CheckBox)
                        {
                            if (((CheckBox)ccitem).AutoPostBack)
                            {
                                ids.Add(ccitem.ClientID);
                            }
                        }
                        else
                        {
                            this.AddNext(ccitem, ref ids);
                        }
                    }
                }
            }
            else if (parent is DetailsView)
            {
                foreach (DetailsViewRow item in ((DetailsView)parent).Rows)
                {
                    foreach (TableCell citem in item.Cells)
                    {
                        foreach (Control ccitem in citem.Controls)
                        {
                            if (ccitem is LinkButton || ccitem is ImageButton || ccitem is Button)
                            {
                                ids.Add(ccitem.ClientID);
                            }
                            else if (ccitem is DropDownList)
                            {
                                if (((DropDownList)ccitem).AutoPostBack)
                                {
                                    ids.Add(ccitem.ClientID);
                                }
                            }
                            else if (ccitem is CheckBox)
                            {
                                if (((CheckBox)ccitem).AutoPostBack)
                                {
                                    ids.Add(ccitem.ClientID);
                                }
                            }
                            else
                            {
                                this.AddNext(ccitem, ref ids);
                            }
                        }
                    }
                }
            }
            else if (parent is DataList)
            {
                foreach (DataListItem item in ((DataList)parent).Items)
                {
                    foreach (Control citem in item.Controls)
                    {
                        if (citem is LinkButton || citem is ImageButton || citem is Button)
                        {
                            ids.Add(citem.ClientID);
                        }
                        else if (citem is DropDownList)
                        {
                            if (((DropDownList)citem).AutoPostBack)
                            {
                                ids.Add(citem.ClientID);
                            }
                        }
                        else if (citem is CheckBox)
                        {
                            if (((CheckBox)citem).AutoPostBack)
                            {
                                ids.Add(citem.ClientID);
                            }
                        }
                        else
                        {
                            this.AddNext(citem, ref ids);
                        }
                    }
                }
            }
            else if (parent is GridView)
            {
                GridView gridView = (GridView)parent;
                foreach (GridViewRow item in gridView.Rows)
                {
                    foreach (TableCell citem in item.Cells)
                    {
                        foreach (Control ccitem in citem.Controls)
                        {
                            if (ccitem is LinkButton || ccitem is ImageButton || ccitem is Button)
                            {
                                ids.Add(ccitem.ClientID);
                            }
                            else if (ccitem is DropDownList)
                            {
                                if (((DropDownList)ccitem).AutoPostBack)
                                {
                                    ids.Add(ccitem.ClientID);
                                }
                            }
                            else if (ccitem is CheckBox)
                            {
                                if (((CheckBox)ccitem).AutoPostBack)
                                {
                                    ids.Add(ccitem.ClientID);
                                }
                            }
                            else
                            {
                                this.AddNext(ccitem, ref ids);
                            }
                        }
                    }
                }
                if (gridView.BottomPagerRow != null)
                {
                    foreach (TableCell citem in gridView.BottomPagerRow.Cells)
                    {
                        foreach (Control ccitem in citem.Controls)
                        {
                            if (ccitem is LinkButton || ccitem is ImageButton || ccitem is Button)
                            {
                                ids.Add(ccitem.ClientID);
                            }
                            else if (ccitem is DropDownList)
                            {
                                if (((DropDownList)ccitem).AutoPostBack)
                                {
                                    ids.Add(ccitem.ClientID);
                                }
                            }
                            else if (ccitem is CheckBox)
                            {
                                if (((CheckBox)ccitem).AutoPostBack)
                                {
                                    ids.Add(ccitem.ClientID);
                                }
                            }
                            else
                            {
                                this.AddNext(ccitem, ref ids);
                            }
                        }
                    }
                }
                if (gridView.TopPagerRow != null)
                {
                    foreach (TableCell citem in gridView.TopPagerRow.Cells)
                    {
                        foreach (Control ccitem in citem.Controls)
                        {
                            if (ccitem is LinkButton || ccitem is ImageButton || ccitem is Button)
                            {
                                ids.Add(ccitem.ClientID);
                            }
                            else if (ccitem is DropDownList)
                            {
                                if (((DropDownList)ccitem).AutoPostBack)
                                {
                                    ids.Add(ccitem.ClientID);
                                }
                            }
                            else if (ccitem is CheckBox)
                            {
                                if (((CheckBox)ccitem).AutoPostBack)
                                {
                                    ids.Add(ccitem.ClientID);
                                }
                            }
                            else
                            {
                                this.AddNext(ccitem, ref ids);
                            }
                        }
                    }
                }
                if (gridView.HeaderRow != null)
                {
                    foreach (TableCell citem in gridView.HeaderRow.Cells)
                    {
                        foreach (Control ccitem in citem.Controls)
                        {
                            if (ccitem is LinkButton || ccitem is ImageButton || ccitem is Button)
                            {
                                ids.Add(ccitem.ClientID);
                            }
                            else if (ccitem is DropDownList)
                            {
                                if (((DropDownList)ccitem).AutoPostBack)
                                {
                                    ids.Add(ccitem.ClientID);
                                }
                            }
                            else if (ccitem is CheckBox)
                            {
                                if (((CheckBox)ccitem).AutoPostBack)
                                {
                                    ids.Add(ccitem.ClientID);
                                }
                            }
                            else
                            {
                                this.AddNext(ccitem, ref ids);
                            }
                        }
                    }
                }
            }
            else if (parent is LinkButton || parent is ImageButton || parent is Button)
            {
                ids.Add(parent.ClientID);
            }
            else if (parent is DropDownList)
            {
                if (((DropDownList)parent).AutoPostBack)
                {
                    ids.Add(parent.ClientID);
                }
            }
            else if (parent is CheckBox)
            {
                if (((CheckBox)parent).AutoPostBack)
                {
                    ids.Add(parent.ClientID);
                }
            }
            else
            {
                foreach (Control ccitem in parent.Controls)
                {
                    if (ccitem is LinkButton || ccitem is ImageButton || ccitem is Button)
                    {
                        ids.Add(ccitem.ClientID);
                    }
                    else if (ccitem is DropDownList)
                    {
                        if (((DropDownList)ccitem).AutoPostBack)
                        {
                            ids.Add(ccitem.ClientID);
                        }
                    }
                    else if (ccitem is CheckBox)
                    {
                        if (((CheckBox)ccitem).AutoPostBack)
                        {
                            ids.Add(ccitem.ClientID);
                        }
                    }
                    else
                    {
                        this.AddNext(ccitem, ref ids);
                    }
                }
            }
              */ 
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="parent"></param>
        void AddNext(Control parent, ref List<string> ids)
        {
            if (parent is IAsyncControlIDsExtender)
            {
                foreach (string item in ((IAsyncControlIDsExtender)parent).ControlIDs)
                {
                    ids.Add(item);
                }
            }
            else if (parent is Table)
            {
                foreach (TableRow item in ((Table)parent).Rows)
                {
                    foreach (TableCell citem in item.Cells)
                    {
                        foreach (Control ccitem in citem.Controls)
                        {
                            if (ccitem is LinkButton || ccitem is ImageButton || ccitem is Button)
                            {
                                ids.Add(ccitem.ClientID);
                            }
                            else if (ccitem is DropDownList)
                            {
                                if (((DropDownList)ccitem).AutoPostBack)
                                {
                                    ids.Add(ccitem.ClientID);
                                }
                            }
                            else if (ccitem is CheckBox)
                            {
                                if (((CheckBox)ccitem).AutoPostBack)
                                {
                                    ids.Add(ccitem.ClientID);
                                }
                            }
                            else
                            {
                                this.AddNext(ccitem, ref ids);
                            }
                        }
                    }
                }
            }
            else if (parent is TableRow)
            {
                foreach (TableCell citem in ((TableRow)parent).Cells)
                {
                    foreach (Control ccitem in citem.Controls)
                    {
                        if (ccitem is LinkButton || ccitem is ImageButton || ccitem is Button)
                        {
                            ids.Add(ccitem.ClientID);
                        }
                        else if (ccitem is DropDownList)
                        {
                            if (((DropDownList)ccitem).AutoPostBack)
                            {
                                ids.Add(ccitem.ClientID);
                            }
                        }
                        else if (ccitem is CheckBox)
                        {
                            if (((CheckBox)ccitem).AutoPostBack)
                            {
                                ids.Add(ccitem.ClientID);
                            }
                        }
                        else
                        {
                            this.AddNext(ccitem, ref ids);
                        }
                    }
                }
            }
            else if (parent is HtmlTable)
            {
                foreach (HtmlTableRow item in ((HtmlTable)parent).Rows)
                {
                    foreach (HtmlTableCell citem in item.Cells)
                    {
                        foreach (Control ccitem in citem.Controls)
                        {
                            if (ccitem is LinkButton || ccitem is ImageButton || ccitem is Button)
                            {
                                ids.Add(ccitem.ClientID);
                            }
                            else if (ccitem is DropDownList)
                            {
                                if (((DropDownList)ccitem).AutoPostBack)
                                {
                                    ids.Add(ccitem.ClientID);
                                }
                            }
                            else if (ccitem is CheckBox)
                            {
                                if (((CheckBox)ccitem).AutoPostBack)
                                {
                                    ids.Add(ccitem.ClientID);
                                }
                            }
                            else
                            {
                                this.AddNext(ccitem, ref ids);
                            }
                        }
                    }
                }
            }
            else if (parent is HtmlTableRow)
            {
                foreach (HtmlTableCell citem in ((HtmlTableRow)parent).Cells)
                {
                    foreach (Control ccitem in citem.Controls)
                    {
                        if (ccitem is LinkButton || ccitem is ImageButton || ccitem is Button)
                        {
                            ids.Add(ccitem.ClientID);
                        }
                        else if (ccitem is DropDownList)
                        {
                            if (((DropDownList)ccitem).AutoPostBack)
                            {
                                ids.Add(ccitem.ClientID);
                            }
                        }
                        else if (ccitem is CheckBox)
                        {
                            if (((CheckBox)ccitem).AutoPostBack)
                            {
                                ids.Add(ccitem.ClientID);
                            }
                        }
                        else
                        {
                            this.AddNext(ccitem, ref ids);
                        }
                    }
                }
            }
            else if (parent is ListView)
            {
                foreach (ListViewDataItem item in ((ListView)parent).Items)
                {
                    foreach (Control citem in item.Controls)
                    {
                        if (citem is HtmlTableCell)
                        {
                            foreach (Control ccitem in citem.Controls)
                            {
                                if (ccitem is LinkButton || ccitem is ImageButton || ccitem is Button)
                                {
                                    ids.Add(ccitem.ClientID);
                                }
                                else if (ccitem is DropDownList)
                                {
                                    if (((DropDownList)ccitem).AutoPostBack)
                                    {
                                        ids.Add(ccitem.ClientID);
                                    }
                                }
                                else if (ccitem is CheckBox)
                                {
                                    if (((CheckBox)ccitem).AutoPostBack)
                                    {
                                        ids.Add(ccitem.ClientID);
                                    }
                                }
                                else
                                {
                                    this.AddNext(ccitem, ref ids);
                                }
                            }
                        }
                    }
                }
            }
            else if (parent is FormView)
            {
                foreach (TableCell citem in ((FormView)parent).Row.Cells)
                {
                    foreach (Control ccitem in citem.Controls)
                    {
                        if (ccitem is LinkButton || ccitem is ImageButton || ccitem is Button)
                        {
                            ids.Add(ccitem.ClientID);
                        }
                        else if (ccitem is DropDownList)
                        {
                            if (((DropDownList)ccitem).AutoPostBack)
                            {
                                ids.Add(ccitem.ClientID);
                            }
                        }
                        else if (ccitem is CheckBox)
                        {
                            if (((CheckBox)ccitem).AutoPostBack)
                            {
                                ids.Add(ccitem.ClientID);
                            }
                        }
                        else
                        {
                            this.AddNext(ccitem, ref ids);
                        }
                    }
                }
            }
            else if (parent is DetailsView)
            {
                foreach (DetailsViewRow item in ((DetailsView)parent).Rows)
                {
                    foreach (TableCell citem in item.Cells)
                    {
                        foreach (Control ccitem in citem.Controls)
                        {
                            if (ccitem is LinkButton || ccitem is ImageButton || ccitem is Button)
                            {
                                ids.Add(ccitem.ClientID);
                            }
                            else if (ccitem is DropDownList)
                            {
                                if (((DropDownList)ccitem).AutoPostBack)
                                {
                                    ids.Add(ccitem.ClientID);
                                }
                            }
                            else if (ccitem is CheckBox)
                            {
                                if (((CheckBox)ccitem).AutoPostBack)
                                {
                                    ids.Add(ccitem.ClientID);
                                }
                            }
                            else
                            {
                                this.AddNext(ccitem, ref ids);
                            }
                        }
                    }
                }
            }
            else if (parent is DataList)
            {
                foreach (DataListItem item in ((DataList)parent).Items)
                {
                    foreach (Control citem in item.Controls)
                    {
                        if (citem is LinkButton || citem is ImageButton || citem is Button)
                        {
                            ids.Add(citem.ClientID);
                        }
                        else if (citem is DropDownList)
                        {
                            if (((DropDownList)citem).AutoPostBack)
                            {
                                ids.Add(citem.ClientID);
                            }
                        }
                        else if (citem is CheckBox)
                        {
                            if (((CheckBox)citem).AutoPostBack)
                            {
                                ids.Add(citem.ClientID);
                            }
                        }
                        else
                        {
                            this.AddNext(citem, ref ids);
                        }
                    }
                }
            }
            else if (parent is GridView)
            {
                GridView gridView = (GridView)parent;
                foreach (GridViewRow item in gridView.Rows)
                {
                    foreach (TableCell citem in item.Cells)
                    {
                        foreach (Control ccitem in citem.Controls)
                        {
                            if (ccitem is LinkButton || ccitem is ImageButton || ccitem is Button)
                            {
                                ids.Add(ccitem.ClientID);
                            }
                            else if (ccitem is DropDownList)
                            {
                                if (((DropDownList)ccitem).AutoPostBack)
                                {
                                    ids.Add(ccitem.ClientID);
                                }
                            }
                            else if (ccitem is CheckBox)
                            {
                                if (((CheckBox)ccitem).AutoPostBack)
                                {
                                    ids.Add(ccitem.ClientID);
                                }
                            }
                            else
                            {
                                this.AddNext(ccitem, ref ids);
                            }
                        }
                    }
                }
                if (gridView.BottomPagerRow != null)
                {
                    foreach (TableCell citem in gridView.BottomPagerRow.Cells)
                    {
                        foreach (Control ccitem in citem.Controls)
                        {
                            if (ccitem is LinkButton || ccitem is ImageButton || ccitem is Button)
                            {
                                ids.Add(ccitem.ClientID);
                            }
                            else if (ccitem is DropDownList)
                            {
                                if (((DropDownList)ccitem).AutoPostBack)
                                {
                                    ids.Add(ccitem.ClientID);
                                }
                            }
                            else if (ccitem is CheckBox)
                            {
                                if (((CheckBox)ccitem).AutoPostBack)
                                {
                                    ids.Add(ccitem.ClientID);
                                }
                            }
                            else
                            {
                                this.AddNext(ccitem, ref ids);
                            }
                        }
                    }
                }
                if (gridView.TopPagerRow != null)
                {
                    foreach (TableCell citem in gridView.TopPagerRow.Cells)
                    {
                        foreach (Control ccitem in citem.Controls)
                        {
                            if (ccitem is LinkButton || ccitem is ImageButton || ccitem is Button)
                            {
                                ids.Add(ccitem.ClientID);
                            }
                            else if (ccitem is DropDownList)
                            {
                                if (((DropDownList)ccitem).AutoPostBack)
                                {
                                    ids.Add(ccitem.ClientID);
                                }
                            }
                            else if (ccitem is CheckBox)
                            {
                                if (((CheckBox)ccitem).AutoPostBack)
                                {
                                    ids.Add(ccitem.ClientID);
                                }
                            }
                            else
                            {
                                this.AddNext(ccitem, ref ids);
                            }
                        }
                    }
                }
                if (gridView.HeaderRow != null)
                {
                    foreach (TableCell citem in gridView.HeaderRow.Cells)
                    {
                        foreach (Control ccitem in citem.Controls)
                        {
                            if (ccitem is LinkButton || ccitem is ImageButton || ccitem is Button)
                            {
                                ids.Add(ccitem.ClientID);
                            }
                            else if (ccitem is DropDownList)
                            {
                                if (((DropDownList)ccitem).AutoPostBack)
                                {
                                    ids.Add(ccitem.ClientID);
                                }
                            }
                            else if (ccitem is CheckBox)
                            {
                                if (((CheckBox)ccitem).AutoPostBack)
                                {
                                    ids.Add(ccitem.ClientID);
                                }
                            }
                            else
                            {
                                this.AddNext(ccitem, ref ids);
                            }
                        }
                    }
                }
            }
            else if (parent is LinkButton || parent is ImageButton || parent is Button)
            {
                ids.Add(parent.ClientID);
            }
            else if (parent is DropDownList)
            {
                if (((DropDownList)parent).AutoPostBack)
                {
                    ids.Add(parent.ClientID);
                }
            }
            else if (parent is CheckBox)
            {
                if (((CheckBox)parent).AutoPostBack)
                {
                    ids.Add(parent.ClientID);
                }
            }
            else
            {
                foreach (Control ccitem in parent.Controls)
                {
                    if (ccitem is LinkButton || ccitem is ImageButton || ccitem is Button)
                    {
                        ids.Add(ccitem.ClientID);
                    }
                    else if (ccitem is DropDownList)
                    {
                        if (((DropDownList)ccitem).AutoPostBack)
                        {
                            ids.Add(ccitem.ClientID);
                        }
                    }
                    else if (ccitem is CheckBox)
                    {
                        if (((CheckBox)ccitem).AutoPostBack)
                        {
                            ids.Add(ccitem.ClientID);
                        }
                    }
                    else
                    {
                        this.AddNext(ccitem, ref ids);
                    }
                }
            }
        }
        /// <summary>
        /// 初始化异步ID序列化。
        /// </summary>
        /// <remarks>初始化异步ID序列化。</remarks>
        /// <param name="control">设置序列化控件。</param>
        public AsyncIDsSerialize(Control control)
        {
            this._control = control;
        }
        /// <summary>
        /// 初始化异步ID序列化。
        /// </summary>
        /// <remarks>初始化异步ID序列化。</remarks>
        /// <param name="control">设置序列化控件。</param>
        /// <param name="ids">设置异步ID列表。</param>
        public AsyncIDsSerialize(Control control, List<string> ids)
        {
            this._control = control;
            this._ids = ids;
        }
    }
}